<?php
/**
 * @package Framework
 * @subpackage Scripts
 */

require('../../system.php');

/*
 *	1=cal_events
 * 2=ab_contacts
 * 3=ab_companies
 * 4=no_notes
 * 5=pmProjects
 * 6=folders
 * 7=bs_orders
*/

$old_path='/var/www/nebulaso.com';
$new_path='/var/www/office.nebulaso.com';


if($GO_SECURITY->has_admin_permission($GO_SECURITY->user_id))
{
	$db1 = new db();
	$db2 = new db();
	
	$sql = "SELECT * FROM fs_shares";
	$db1->query($sql);
	while($db1->next_record())
	{
		$path = str_replace($old_path, $new_path, $db1->f('path'));
		
		$sql = "UPDATE fs_shares SET path='".addslashes($path)."' WHERE path='".addslashes($db1->f('path'))."'";
		$db2->query($sql);
	}
	
	echo 'All done!';
}else
{
	echo 'Please log in as administrator to use this script';
}
